<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">
 
        <ui:define name="content">
            <h:panelGroup id="messagePanel" layout="block">
<!--                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>-->
            </h:panelGroup>
            <h:form prependId="false">
                <p:panel toggleable="true" id="rawMaterialView" header="Raw Material Information">
                 <h:panelGrid id="display" columns="2" cellpadding="4">  
                    
                    <h:outputText value="Raw Material Name: " />  
                    <h:outputText  
                            value="#{rawMaterialEntityController.selected.productName}" />  
                     <h:outputText value="Shelf Life(month): " />  
                     <h:outputText 
                            value="#{rawMaterialEntityController.selected.shelfLife}"/> 
                    
                     <h:outputText value="Lead Tme(week): " />  
                     <h:outputText 
                            value="#{rawMaterialEntityController.selected.leadTime}" /> 
                     
                     <h:outputText value="Lot Size(kg/l): " />  
                     <h:outputText 
                            value="#{rawMaterialEntityController.selected.lotSize}" />
                     
                    
                   
                   </h:panelGrid>  
                </p:panel>
                <br/>
                
                
                <p:panel toggleable="true" id="supplier" header="Suppliers For this Raw Material" rendered="#{rawMaterialEntityController.selected.vendor.size()>0}">
                   <p:dataTable value="#{rawMaterialEntityController.selected.vendor}" var="item" 
                                  
                             style="text-align: center"
                                     paginator="true" rows="15"  
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                     rowsPerPageTemplate="5,10,15">
                                  
                                     

                            
                            <p:column sortBy="#{item.name}">
                                <f:facet name="header">
                                    <h:outputText value="Contact Person Name"/>
                                </f:facet>
                                <h:outputText value="#{item.name}"/>
                            </p:column> 
                            
                             <p:column sortBy="#{item.companyName}">
                                <f:facet name="header">
                                    <h:outputText value="company Name"/>
                                </f:facet>
                                <h:outputText value="#{item.companyName}"/>
                            </p:column> 
                            
                             
                            
                           
                 </p:dataTable>   
                  
                </p:panel>
               
               
                <p:commandButton ajax="false" value="Back" action="#{rawMaterialEntityController.prepareList}" />
                
            </h:form>
           
        </ui:define>
    </ui:composition>

</html>
